﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AMS.DataAccess.Filter
{
    /// <summary>
    /// 
    /// </summary>
    public class BooleanFilterField : FilterField
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="value"></param>
        public BooleanFilterField(bool value)
            : this(value, BooleanOperations.Equals)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="value"></param>
        /// <param name="operation"></param>
        public BooleanFilterField(bool value, BooleanOperations operation)
        {
            field = new IntegerFilterField(value, operation);
        }

        private IntegerFilterField field;

        /// <summary>
        /// 
        /// </summary>
        public bool Value
        {
            get { return Convert.ToBoolean(field.Value); }
        }

        /// <summary>
        /// 
        /// </summary>
        public BooleanOperations Operation
        {
            get { return (BooleanOperations)field.Operation; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return field.ToString();
        }
    }
}
